Repository navigation
fix: refuse overflowing tile geometry and oversized sidecars - #1
Merged
Merged
Conversation
A tree wider than 2^63 made split_point panic in debug and loop in release. A perfect subtree whose span does not fit in a u64 is refused.
The u16 pair count and key length were truncated, so a wide key set was written as a sidecar no reader could decode. A bundle wider than 256 entries is refused because the offset is one byte.
Sizes 0, 1, 2 and either side of a power of two are compared with a second implementation of the RFC 9162 recursion, and a flipped, truncated or extended proof is rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounds fixes for tile trees built from untrusted sizes.
split_pointdoubled untilsplit * 2overflowed. A checkpoint size above 2^63 panicked in debug and spun in release before any tile was read.perfectshifted1u64 << heightfor heights of 64 or more and usedsaturating_add, so an overflowing span could pass the bounds check.u16, so 65536 pairs were stored as 0. A bundle wider than 256 wrapped the one-byte offset. The writer now refuses values the format cannot hold.Roots for 1 to 8 leaves match an independent SHA-256 implementation of section 2.1. fmt, clippy, the workspace tests, the doc tests,
cargo publish --dry-run,towncrier build --draftand the docs build pass. Each commit has a towncrier fragment.